package com.spring.pick2pick;

import java.util.Locale;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.spring.pick2pick.dao.SportDao;

@Controller
public class SportController {
	
	@Autowired
	SportDao sportDao;
	
	/** 종목 리스트 목록 */
	@RequestMapping(value = "listSport", method = RequestMethod.GET)
	public String listSport(Locale locale, Model model, HttpServletRequest request) {
		
		model.addAttribute("count", sportDao.getSportCount());
		model.addAttribute("list", sportDao.getSportList("DESC"));
		
		return "team/listSport";
	}

}
